//
//  BC_Move.h
//  GameTree
//
//  Created by BrunoCausse on 13/11/10.
//  Copyright 2010-2013 poulailler cie. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "BC_Const.h"

extern NSString * const BCTitleKey;
extern NSString * const BCScoreKey;
extern NSString * const BCTimeKey;
extern NSString * const BCCommentKey;
extern NSString * const BCImageIDKey;
extern NSString * const BCPVKey;


@interface BC_Move : NSObject {
	
	NSString					*title;						/*< coordonnée of this move */
	
	int							position[MAX_FLIP];			/*< affected square position */
	int							nFlips;						/*< number of flipped discs */
	float						score;                      /*< score for this move */
    
    unsigned long long          hashcode;                   /*< hashcode */
	
	float						time;						/*< time for this move*/
	
	NSAttributedString			*comment;					/*< commentaire for this move*/
	int							imageID;					/*< image identifier for this move*/
	
	BOOL						pv;							/*< principal variation flag*/
	

}

#pragma mark setter getter methods

@property(readwrite, retain) NSString *title; //copy ????
@property(readwrite, retain) NSAttributedString *comment; // copy ?????
@property(readwrite, assign) int nFlips, imageID;
@property(readwrite, assign) float score, time;
@property(readwrite, assign) BOOL pv;
@property(readwrite, assign) unsigned long long hashcode;

- (int) positionAtIndex:(int)index;
- (void) setPosition:(int)value atIndex:(int)index;

- (int)increment_nFlips;


#pragma mark init methods

- (id)init;
- (id)initWithLocation:(int)pos;

- (void)XORHashcode:(unsigned long long)hash;


#pragma mark utilities methods

+ (NSString *)indexToString:(int)aIndex;
+ (int)stringToIndex:(NSString *)aString;

#pragma mark un/archiving methods

+ (BC_Move*)moveWithContents:(NSDictionary *)dictionary;
- (NSDictionary *)contents;



@end
